package org.dromara.web.CssUtil;

import org.dromara.app.service.ISkAppUserService;
import org.dromara.app.service.ISkYueDanOrderService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;

@Configuration
public class RedisListenerConfig {
    @Bean
    RedisMessageListenerContainer listenerContainer(RedisConnectionFactory connectionFactory) {
        RedisMessageListenerContainer listenerContainer = new RedisMessageListenerContainer();
        listenerContainer.setConnectionFactory(connectionFactory);
        return listenerContainer;
    }

    @Bean
    KeyExpirationEventMessageListener redisKeyExpirationListener(RedisMessageListenerContainer listenerContainer, ISkYueDanOrderService iSkYueDanOrderService, ISkAppUserService iSkAppUserService,CssOrderServer cssOrderServer) {
        return new RedisKeyExpirationListener(listenerContainer, iSkYueDanOrderService,iSkAppUserService,cssOrderServer);
    }

}
